#ifndef MegabriteController_h
#define MegabriteController_h
#import "Megabrite.h"


class MegabriteController {
	public:
		int datapin, latchpin, enablepin, clockpin;
		void init();
		void setNumberOfMegabrites(int);
		Megabrite* getMegabriteAtIndex(int);
		void send();
	private:
		Megabrite **megabrites;
		int numberOfMegabrites;
		void createMegabrites(int);

		void SB_SendPacket();
		int SB_CommandMode;
		int SB_RedCommand, SB_GreenCommand, SB_BlueCommand;
		int limit(int);
};

/**
 * Create a MegabriteController with the given number of megabrites
 */
MegabriteController* newMegabriteController();

#endif

